home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 8
/
QRZ Ham Radio Callsign Database - Volume 8.iso
/
pc
/
files
/
p_msys
/
msysb116.exe
/
CALLSRV0.C
< prev
next >
Wrap
Text File
|
1992-01-10
|
1KB
|
66 lines
#define INTR 0xd1
#include <dos.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
/* COMPILE USING LARGE MEMORY MODEL USING TURBO C++ */
/* reduce heaplength and stacklength
to make a smaller program in memory */
extern unsigned _heaplen = 512;
extern unsigned _stklen = 2048;
unsigned mygetpsp()
{
union REGS regs;
regs.x.ax=0x5100;
int86(0x21,®s,®s);
return regs.x.bx;
}
mysetpsp(int pspadr)
{
union REGS regs;
regs.x.ax= 0x5000;
regs.x.bx= pspadr;
int86(0x21,®s,®s);
}
void get_qth (char far *call,char far *buffer);
void interrupt handler(bp,di,si,ds,es,dx,cx,bx,ax,ip,cs,flags)
{
char far *arg1, far *arg2;
static savepsp;
savepsp=mygetpsp();
mysetpsp(_psp);
arg1=MK_FP(ax,bx);
arg2=MK_FP(cx,dx);
get_qth(arg1,arg2);
mysetpsp(savepsp);
}
int main(int argc, char *argv)
{
/* install the new interrupt handler */
setvect(INTR, handler);
keep(0, (_SS + ((_SP +2048)/16) - _psp));
return 0;
}
void get_qth (char far *call,char far *buffer)
{
strcpy(buffer,call);
strcat(buffer," not found\n");
}